/*
 * @Author: 姚潘涛
 * @Date: 2024-06-03 11:09:46
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-10-10 17:25:24
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#pragma once
#ifndef UNION_DATA_TYPE_HPP
#define UNION_DATA_TYPE_HPP

#include "stdint.h"
#include "xict_common/perception/common/config.h"
namespace xict_common {
    namespace utils {
        union Uint16_bytes {
            uint16_t data;
            uint8_t bytes[2];
        };
        union Uint32_bytes {
            uint32_t data;
            uint8_t bytes[4];
        };
        union Uint64_bytes {
            uint64_t data;
            uint8_t bytes[8];
        };

        union Int16_bytes {
            int16_t data;
            uint8_t bytes[2];
        };
        union Int32_bytes {
            int32_t data;
            uint8_t bytes[4];
        };
        union Int64_bytes {
            int64_t data;
            uint8_t bytes[8];
        };

        union Float_bytes {
            float data;
            uint8_t bytes[sizeof(float)];
        };
        union Double_bytes {
            double data;
            uint8_t bytes[sizeof(double)];
        };

        struct YoloKernel {
            int width;
            int height;
            float anchors[kNumAnchor * 2];
        };

        struct alignas(float) Detection {
            float bbox[4];   // center_x center_y w h
            float conf;      // bbox_conf * cls_conf
            float class_id;
            float mask[32];
        };
    }   // namespace utils
}   // namespace xict_common
#endif   // UNION_DATA_TYPE_HPP
